﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Media.Animation;
using cecbClasses.Data_Adapters.Login;
using cecbClasses.Data_Adapters;

namespace CECB.Dashbord
{
    /// <summary>
    /// Interaction logic for DashSlider_Window.xaml
    /// </summary>
    public partial class DashSlider_Window : Window
    {
        public DashSlider_Window()
        {
            InitializeComponent();
            (FindResource("showMe") as Storyboard).Begin(this);
            (FindResource("drop") as Storyboard).Begin(this);

            cecbClasses.Data_Adapters.Slider slid = new cecbClasses.Data_Adapters.Slider();
            ProjectAutocompleteTextBox.ItemsSource = slid.getProjectDetails();
            TeamAutocompleteTextBox.ItemsSource = slid.getTeamDetails();


        }

        private void ReferenceTextBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            cecbClasses.Data_Adapters.Slider slid = new cecbClasses.Data_Adapters.Slider();
           

            (FindResource("drop") as Storyboard).Begin(this);
            
             
             xx.DataContext = slid.getProjectDetailsByRef(ProjectAutocompleteTextBox.Text);

            

        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            (FindResource("drop1") as Storyboard).Begin(this);
            (FindResource("drop") as Storyboard).Begin(this);
        }

        private void TeamReferenceTextBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            cecbClasses.Data_Adapters.Slider slid = new cecbClasses.Data_Adapters.Slider();


            (FindResource("drop1") as Storyboard).Begin(this);
           
             
            wrapPanelTeam.DataContext = slid.getTeamDetailsByRef(TeamAutocompleteTextBox.Text);
            listBoxTeamMembers.ItemsSource = null;
            listBoxTeamMembers.ItemsSource = slid.getTeamMembersNamesByRef(TeamAutocompleteTextBox.Text);
            listBoxTeamPro.ItemsSource = null;
            listBoxTeamPro.ItemsSource = slid.getTeamProjectsByTeam(TeamAutocompleteTextBox.Text);
        }

        private void button_createProjects_Click(object sender, RoutedEventArgs e)
        {

        }

        private void buttonAddMember_Click(object sender, RoutedEventArgs e)
        {

        }

        private void CloseButton_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
